Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lens] Remove scss from annotations plugin, visualization-ui-components and gauge expression #208891

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

mbondyra
Copy link
Contributor

@mbondyra mbondyra commented Jan 30, 2025

Summary

part of #208908

Replaces scss to css-in-js. I've tested all the changes.

@mbondyra mbondyra added Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens v9.0.0 backport:version Backport to applied version labels v8.18.0 labels Jan 30, 2025
@mbondyra mbondyra requested review from a team as code owners January 30, 2025 09:34
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

@mbondyra mbondyra added the release_note:skip Skip the PR/issue when compiling release notes label Jan 30, 2025
@mbondyra mbondyra changed the title [Lens] Remove scss from annotations plugin [Lens] Remove scss from annotations plugin nad visualization-ui-components Jan 30, 2025
@mbondyra mbondyra changed the title [Lens] Remove scss from annotations plugin nad visualization-ui-components [Lens] Remove scss from annotations plugin, visualization-ui-components and gauge expression Jan 30, 2025
Copy link
Contributor

@MichaelMarcialis MichaelMarcialis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @mbondyra. I've left two small comments/question regarding whether we can reduce some style repetition/redundancy, but this looks good to me otherwise. Assuming you're able to address those, I'll approve now so I don't hold you up.

Comment on lines 370 to 374
css={css`
& + .lnsRowCompressedMargin {
margin-top: ${euiThemeVars.euiSizeS};
}
`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This same style is used multiple times throughout this PR. To keep things DRY, would it be better to store this style in a separate .style.ts file and reference that one style in all locations, rather than repeating the style?

Comment on lines 65 to 68
css: {
color: !fieldOption.compatible ? euiThemeVars.euiColorLightShade : undefined,
backgroundColor: !fieldOptionExists ? euiThemeVars.euiColorLightestShade : undefined,
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here as previous. Is there anything that can be done here to avoid repeating the same styles?

} from '@elastic/eui';
import type { DataViewBase, Query } from '@kbn/es-query';
import { css } from '@emotion/react';
import { euiThemeVars } from '@kbn/ui-theme';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like the EUI team is asking people to move away from using euiThemeVars and instead using the useEuiTheme hook. See #199715 and search for euiThemeVars.

Before:

import { EuiIcon, EuiCode, EuiText, useEuiTheme } from '@elastic/eui';
height: ${euiThemeVars.euiSizeXS} / 2;

After:

import { useEuiTheme } from '@elastic/eui'
const { euiTheme } = useEuiTheme();
height: ${euiTheme.size.xs} / 2;

@elasticmachine
Copy link
Contributor

elasticmachine commented Feb 5, 2025

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #2 / AnnotationsPanel Dimension Editor calculates correct endTimstamp and transparent color when switching for range annotation and back
  • [job] [logs] Jest Tests #2 / AnnotationsPanel Dimension Editor calculates correct endTimstamp and transparent color when switching for range annotation and back
  • [job] [logs] Jest Tests #2 / AnnotationsPanel Dimension Editor should avoid to retain range manual configurations when switching to query based annotations
  • [job] [logs] Jest Tests #2 / AnnotationsPanel Dimension Editor should avoid to retain range manual configurations when switching to query based annotations
  • [job] [logs] Jest Tests #2 / AnnotationsPanel Dimension Editor should avoid to retain specific manual configurations when switching to query based annotations
  • [job] [logs] Jest Tests #2 / AnnotationsPanel Dimension Editor should avoid to retain specific manual configurations when switching to query based annotations
  • [job] [logs] Jest Tests #2 / AnnotationsPanel Dimension Editor should fallback to the first date field available in the dataView if not time-based
  • [job] [logs] Jest Tests #2 / AnnotationsPanel Dimension Editor should fallback to the first date field available in the dataView if not time-based
  • [job] [logs] Jest Tests #2 / AnnotationsPanel Dimension Editor should prefill timeField with the default time field when switching to query based annotations
  • [job] [logs] Jest Tests #2 / AnnotationsPanel Dimension Editor should prefill timeField with the default time field when switching to query based annotations
  • [job] [logs] Jest Tests #2 / AnnotationsPanel Dimension Editor should set a default tiemstamp when switching from query based to manual annotations
  • [job] [logs] Jest Tests #2 / AnnotationsPanel Dimension Editor should set a default tiemstamp when switching from query based to manual annotations
  • [job] [logs] Jest Tests #2 / AnnotationsPanel Dimension Editor shows correct options for line annotations
  • [job] [logs] Jest Tests #2 / AnnotationsPanel Dimension Editor shows correct options for line annotations
  • [job] [logs] Jest Tests #2 / AnnotationsPanel Dimension Editor shows correct options for query based
  • [job] [logs] Jest Tests #2 / AnnotationsPanel Dimension Editor shows correct options for query based
  • [job] [logs] Jest Tests #2 / AnnotationsPanel Dimension Editor shows correct options for range annotations
  • [job] [logs] Jest Tests #2 / AnnotationsPanel Dimension Editor shows correct options for range annotations
  • [job] [logs] Jest Tests #19 / event annotation group editor removes an annotation from a group
  • [job] [logs] Jest Tests #19 / event annotation group editor removes an annotation from a group
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor reduced time range should not show the reduced time range component if reduced time range is not available
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor reduced time range should not show the reduced time range component if reduced time range is not available
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor should indicate fields which are incompatible for the operation of the current column
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor should indicate fields which are incompatible for the operation of the current column
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor should indicate operations which are incompatible for the field of the current column
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor should indicate operations which are incompatible for the field of the current column
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor should indicate that reference-based operations are compatible sometimes
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor should indicate that reference-based operations are compatible sometimes
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor should indicate that reference-based operations are not compatible when they are incomplete
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor should indicate that reference-based operations are not compatible when they are incomplete
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor should keep the field when switching to another operation compatible for this field
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor should keep the field when switching to another operation compatible for this field
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor should keep the label on operation change if it is custom
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor should keep the label on operation change if it is custom
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor should keep the operation when switching to another field compatible with this operation
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor should keep the operation when switching to another field compatible with this operation
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor should not keep the label as long as it is the default label
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor should not keep the label as long as it is the default label
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor should remove customLabel flag if label is set to default
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor should remove customLabel flag if label is set to default
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor time scaling should allow to change time scaling
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor time scaling should allow to change time scaling
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor time scaling should allow to set time scaling initially
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor time scaling should allow to set time scaling initially
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor time scaling should carry over time scaling to other operation if possible
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor time scaling should carry over time scaling to other operation if possible
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor time scaling should default to None if time scaling is not set
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor time scaling should default to None if time scaling is not set
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor time scaling should not adjust label if it is custom
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor time scaling should not adjust label if it is custom
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor time scaling should not carry over time scaling if the other operation does not support it
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor time scaling should not carry over time scaling if the other operation does not support it
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor time scaling should show current time scaling if set
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor time scaling should show current time scaling if set
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor transient invalid state should indicate document and field compatibility with selected document operation
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor transient invalid state should indicate document and field compatibility with selected document operation
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor transient invalid state should keep current state and write incomplete column when transitioning from incomplete reference-based operations to field operation
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor transient invalid state should keep current state and write incomplete column when transitioning from incomplete reference-based operations to field operation
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor transient invalid state should select the Records field when count is selected on non-existing column
  • [job] [logs] Jest Tests #9 / FormBasedDimensionEditor transient invalid state should select the Records field when count is selected on non-existing column

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
eventAnnotationListing 741 705 -36
expressionGauge 102 82 -20
lens 1813 1777 -36
observability 1353 1317 -36
total -128

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
eventAnnotationListing 241.0KB 231.4KB -9.6KB
expressionGauge 24.0KB 16.5KB -7.6KB
lens 1.6MB 1.6MB -4.1KB
observability 1.3MB 1.3MB +48.8KB
total +27.5KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
eventAnnotationListing 10.9KB 11.0KB +163.0B
expressionGauge 13.8KB 13.9KB +87.0B
lens 50.2KB 50.2KB -1.0B
observability 102.4KB 102.8KB +420.0B
total +669.0B
Unknown metric groups

async chunk count

id before after diff
eventAnnotationListing 5 6 +1
observability 21 25 +4
total +5

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.19.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants